package thread.dartyRead;

public class Entity extends Thread{
	private Integer x=1;
	private Integer y=1;
	@Override
	public void run() {
		this.setX(100);
		super.run();
	}
	public Integer getX() {
		return x;
	}
	public synchronized void setX(Integer x) {
		this.x = x;
		try {
			Thread.sleep(1000);
			System.out.println(this.getX());
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
	public Integer getY() {
		return y;
	}
	public void setY(Integer y) {
		this.y = y;
	}
	
}
